home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / extras / Direct3D / Tools / 3DSMax4 / readme.txt < prev    next >
Encoding:
Text File  |  2001-10-08  |  8.4 KB  |  193 lines

  1. A 3DSMaxR4 -> X-file exporter with support for Physique modifiers.
  2.  
  3. ****  NOTE: The exporter binary has been compiled for CharacterStudio 3.0.  If skinning support is broken, recompile with the CStudio SDK provided with your version.  
  4.  
  5. Installation
  6. ------------
  7.  
  8. Copy XSkinExp.dle into <3DSMAXR4 path>\plugins
  9.  
  10. Usage
  11. -----
  12.  
  13. 1) Setup your scene.
  14. 2) Choose export (or export selected) from the File menu.
  15. 3) Select a filename through the standard dialog that should pop up.
  16. 4) Select an X-file data format to use (text, binary or binary+compressed).
  17. 5) Hit Go!
  18.  
  19. Notes
  20. -----
  21.  
  22. 1) The exporter currently only exports base objects (i.e. modifier stacks are ignored).  So any modifiers that you apply must be collapsed before export.  You can save your data to a MAX file before collapsing if you want to get your modifier stacks back.  The exception is the physique modifiers - see (2).
  23.  
  24. 2) If you use physique, before export make sure that no modifiers exist below either one in the stack.  Any modifiers above or below physique are just ignored.
  25.  
  26. 3) Currently only the diffuse texture is exported (absolute file path), and at most one set of texture coordinates (applied with a UVW modifier for example, and then collapsed before export).
  27.  
  28. 4) Material properties exported are:
  29.     - diffuse color
  30.     - transparency
  31.     - power (shininess strengh in 3DS... correct?)
  32.     - specular color
  33.     - emissive color
  34.     - texture file name (diffuse texture absolute file path).
  35.  
  36. 5) Materials may be per-mesh or per-face (multi-material).  
  37.  
  38. 6) Faces are always triangles.
  39.  
  40. 7) The export process guarantees that all frames (bones/nodes, whatever you want to call them) in the scene hierarchy get unique string names.  If a node has a name in 3DS, the exported name will use that, and append numbers if necessary to guarantee uniqueness.  3DS node names also have to be "censored" to support the character restrictions for strings in the x-file format.
  41.  
  42. 8) See the Notes on New Templates to learn about extensions added to the X-File format...
  43.  
  44. 9) The definitions of any new templates are always listed at the beginning of exported x-files.
  45.  
  46. Notes on New Templates
  47. ----------------------
  48. The c header file appended to the bottom of this readme may be used to help read the custom templates added to the x-file format.
  49.  
  50. For now, these templates are:
  51.  
  52. 1) VertexDuplicationIndices
  53.  
  54.         template VertexDuplicationIndices
  55.         {
  56.             <B8D65549-D7C9-4995-89CF-53A9A8B031E3>
  57.             DWORD nIndices;
  58.             DWORD nOriginalVertices;
  59.             array DWORD indices[nIndices];
  60.         }
  61.  
  62. This template is instantiated on a per-mesh basis, holding information about which vertices in the mesh are duplicates of each other.  Duplicates result when a vertex sits on a smoothing group or material boundary.  The purpose of this template is to allow the loader to determine which vertices exhibiting different peripheral parameters are actually the same vertex in the model.  Certain applications (mesh simplification for example) can make use of this information.
  63.  
  64. Fields: 
  65.  
  66. DWORD nIndices --  the number of indices in the array indices[nIndices].  This will be equal to the number of vertices in the current mesh.
  67.  
  68. DWORD nOriginalVertices -- the number of vertices in the mesh before any duplication occured.
  69.  
  70. array DWORD indices[nIndices] -- indices[n] holds the vertex index that vertex[n] in the vertex array for the mesh would have had if no duplication had occured.  So any indices in this array that are the same indicate duplicated vertices.
  71.  
  72. 2) XSkinMeshHeader
  73.  
  74.         template XSkinMeshHeader
  75.         {
  76.             <3CF169CE-FF7C-44ab-93C0-F78F62D172E2>
  77.             WORD nMaxSkinWeightsPerVertex;
  78.             WORD nMaxSkinWeightsPerFace;
  79.             WORD nBones; 
  80.         }
  81.  
  82. This template is instantiated on a per-mesh basis only in meshes that contain exported skinning information.  The purpose of this template is to provide information about the nature of the skinning information that was exported.
  83.  
  84. Fields:
  85. WORD nMaxSkinWeightsPerVertex -- the maximum number of transfoms that affect a vertex in the mesh.
  86.  
  87. WORD nMaxSkinWeightsPerFace -- the maximum number of unique transforms that affect the three vertices of any face.
  88.  
  89. WORD nBones -- the number of bones that affect vertices in this mesh
  90.  
  91. 3) SkinWeights
  92.  
  93.         template SkinWeights
  94.         { 
  95.             <6F0D123B-BAD2-4167-A0D0-80224F25FABB> 
  96.             STRING transformNodeName;
  97.             DWORD nWeights; 
  98.             array DWORD vertexIndices[nWeights]; 
  99.             array float weights[nWeights]; 
  100.             Matrix4x4 matrixOffset; 
  101.         } 
  102.  
  103. This template is instantiated on a per-mesh basis.  Within a mesh, a sequence of n instances of this template will show up, where n is the number of bones (X file frames) which influence the vertices in the mesh.  Each instance of the template basically defines the influence of a particular bone on the mesh.  There is a list of vertex indices, and a corresponding list of weights.
  104.  
  105. Fields:
  106. STRING transformNodeName -- the name of the bone whose influence we are defining.
  107.  
  108. DWORD nWeights -- the number of vertices affected by this bone
  109.  
  110. array DWORD vertexIndices[nWeights] -- the vertices influenced by this bone
  111.  
  112. array float weights[nWeights] -- the weights for each of the vertices influenced by this bone
  113.  
  114. Matrix4x4 matrixOffset -- this matrix transforms the mesh vertices to the space of the bone. This when cancatenated to the bone's transform will give the world space coordinates of the mesh as affected by the bone.
  115.  
  116. 4) Addition to AnimationKey
  117.  
  118.     template AnimationKey
  119.     {
  120.         <10DD46A8-775B-11cf-8F52-0040333594A3>
  121.         DWORD keyType;
  122.         DWORD nKeys;
  123.         array keys TimedFloatKeys[nKeys];
  124.     }
  125.  
  126. This is an existing template in .X files. This has been extended to support a new key type of 4 which is a matrix key (in addition to position, rotation and scale). For example:
  127.  
  128. AnimationKey 
  129. {
  130.     4;
  131.     2;
  132.     0;16;   0.999841,-0.017505, 0.003500,0.000000,
  133.             0.017664, 0.998492,-0.051979,0.000000,
  134.            -0.002585, 0.052033, 0.998642,0.000000,
  135.        28.181364,-0.033845, 0.001760,1.000000;;,
  136.     160;16; 0.999854,-0.016764, 0.003258,0.000000,
  137.         0.016922, 0.998239,-0.056864,0.000000,
  138.        -0.002299, 0.056911, 0.998377,0.000000,
  139.        28.181427,-0.033822, 0.001927,1.000000;;,
  140. }
  141. This was added to export animations from Biped plug-in. Biped does not give access to position / rotation / scale components of the animation. These matrices need to be decomposed by the application to get interpolable components.
  142.  
  143. Useful Header
  144. -------------
  145. The rest of this readme contains a useful header file, used in the export process, and useful for your loader, if you use the X File loading API in the DirectX SDK.
  146.  
  147. //-----------------------------------------------------------------------------
  148. // File: XSkinExpTemplates.h
  149. //
  150. // Desc: Custom templates used for skin export format.
  151. //
  152. // Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
  153. //-----------------------------------------------------------------------------
  154. #ifndef __XSKINEXPTEMPLATES_H__
  155. #define __XSKINEXPTEMPLATES_H__
  156.  
  157. // {3CF169CE-FF7C-44ab-93C0-F78F62D172E2}
  158. DEFINE_GUID(DXFILEOBJ_XSkinMeshHeader,
  159. 0x3cf169ce, 0xff7c, 0x44ab, 0x93, 0xc0, 0xf7, 0x8f, 0x62, 0xd1, 0x72, 0xe2);
  160.  
  161. // {B8D65549-D7C9-4995-89CF-53A9A8B031E3}
  162. DEFINE_GUID(DXFILEOBJ_VertexDuplicationIndices, 
  163. 0xb8d65549, 0xd7c9, 0x4995, 0x89, 0xcf, 0x53, 0xa9, 0xa8, 0xb0, 0x31, 0xe3);
  164.  
  165. // {6F0D123B-BAD2-4167-A0D0-80224F25FABB}
  166. DEFINE_GUID(DXFILEOBJ_SkinWeights, 
  167. 0x6f0d123b, 0xbad2, 0x4167, 0xa0, 0xd0, 0x80, 0x22, 0x4f, 0x25, 0xfa, 0xbb);
  168.  
  169. #define XSKINEXP_TEMPLATES \
  170.         "xof 0303txt 0032\
  171.         template XSkinMeshHeader \
  172.         { \
  173.             <3CF169CE-FF7C-44ab-93C0-F78F62D172E2> \
  174.             WORD nMaxSkinWeightsPerVertex; \
  175.             WORD nMaxSkinWeightsPerFace; \
  176.         } \
  177.         template VertexDuplicationIndices \
  178.         { \
  179.             <B8D65549-D7C9-4995-89CF-53A9A8B031E3> \
  180.             DWORD nIndices; \
  181.             DWORD nOriginalVertices; \
  182.             array DWORD indices[nIndices]; \
  183.         } \
  184.         template SkinWeights \
  185.         { \
  186.             <6F0D123B-BAD2-4167-A0D0-80224F25FABB> \
  187.             STRING transformNodeName;\
  188.             DWORD nWeights; \
  189.             array DWORD vertexIndices[nWeights]; \
  190.             array float weights[nWeights]; \
  191.             Matrix4x4 matrixOffset; \
  192.         } \
  193. #endif //__XSKINEXPTEMPLATES_H__